<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<div class="t_bar"><span class="color_red">*</span>${param.title7 }（限100条）</div>
<table  id="milestone_edit" border="0" cellspacing="0" cellpadding="0" class="table01 t_css" >
		<thead>
			<tr>
                <th width="5%" >选择</th>
                <th width="5%" >序号</th>
				<th width="15%">姓名</th>
				<th width="15%">性别</th>
				<th width="15%">学位</th>
				<th width="15%">专业</th>
				<th width="15%">职称</th>
				<th width="15%">国籍</th>
				
			</tr>
		</thead>
		<tbody id="tab">
			<tr style="display: none"  align="center">
				<td align="center">
					<input type="radio" class="radiobutton" name="selMilestone_edit" >
					
					<input type="hidden" name="milestones|milestone[0]|equipments"  label="xml">
					<input type="hidden" name="milestones|milestone[0]|certificates"  label="xml">
					
					<input type="hidden" name="milestones|milestone[0]|gender_value">
					<input type="hidden" name="milestones|milestone[0]|birthday">
					<input type="hidden" name="milestones|milestone[0]|country_value">
					<input type="hidden" name="milestones|milestone[0]|degree_value">
					<input type="hidden" name="milestones|milestone[0]|prof_title_value">
					<input type="hidden" name="milestones|milestone[0]|qualification">
					<input type="hidden" name="milestones|milestone[0]|card_type_name">
					<input type="hidden" name="milestones|milestone[0]|oversea_value">
					<input type="hidden" name="milestones|milestone[0]|oversea_name">
					<input type="hidden" name="milestones|milestone[0]|before_address">
					<input type="hidden" name="milestones|milestone[0]|before_position">
					<input type="hidden" name="milestones|milestone[0]|before_dept">
					<input type="hidden" name="milestones|milestone[0]|come_time">
					<input type="hidden" name="milestones|milestone[0]|mobile">
					<input type="hidden" name="milestones|milestone[0]|email">
					<input type="hidden" name="milestones|milestone[0]|state_plan">
					<input type="hidden" name="milestones|milestone[0]|state_time">
					<input type="hidden" name="milestones|milestone[0]|state_declared">
					<input type="hidden" name="milestones|milestone[0]|local_plan">
					<input type="hidden" name="milestones|milestone[0]|local_time">
					<input type="hidden" name="milestones|milestone[0]|plan_level_value">
					<input type="hidden" name="milestones|milestone[0]|plan_level_name">
					<input type="hidden" name="milestones|milestone[0]|get_cost">
					<input type="hidden" name="milestones|milestone[0]|achievements_hidden">
					<input type="hidden" name="milestones|milestone[0]|achievements">
				</td>
				<td align="center">
					<span name="milestones|milestone[0]@seq_no">[index]</span>
				</td>
				<td align="center">
					<span name="milestones|milestone[0]|zh_name"></span>
				</td>
				<td align="center">
					<span name="milestones|milestone[0]|gender_name"></span>
				</td>
				<td align="center">
					<span name="milestones|milestone[0]|degree_name"></span>
				</td>
				<td align="center">
					<span name="milestones|milestone[0]|major_work"></span>
				</td>
				<td align="center">
					<span name="milestones|milestone[0]|prof_title_name"></span>
				</td>
				<td align="center">
					<span name="milestones|milestone[0]|country_name"></span>
				</td>
			</tr>
			<c:set value="0" var="index" scope="page" />
			<x:forEach select="$xmlData/data/milestones/milestone" var="milestone">
				<c:choose>
					<c:when test="${index<10}">
						<c:set value="0" var="flag" scope="page" />
					</c:when>
					<c:otherwise>
						<c:set value="" var="flag" scope="page" />
					</c:otherwise>
				</c:choose>
				<tr  align="center" >
					<td  width="50px" >
						<input type="radio" name="selMilestone_edit"/> 
						<input type="hidden" name="milestones/milestone[${flag}${index}]/equipments" value="<x:out select="$milestone/equipments" />" label="xml"/>
						<input type="hidden" name="milestones/milestone[${flag}${index}]/certificates" value="<x:out  select="$milestone/certificates" />" label="xml"/>
																										
						<input type="hidden" name="milestones/milestone[${flag}${index}]/gender_value" value="<x:out select="$milestone/gender_value" />"/>
						<input type="hidden" name="milestones/milestone[${flag}${index}]/birthday" value="<x:out select="$milestone/birthday" />"/>
						<input type="hidden" name="milestones/milestone[${flag}${index}]/country_value" value="<x:out select="$milestone/country_value" />"/>
						<input type="hidden" name="milestones/milestone[${flag}${index}]/degree_value" value="<x:out select="$milestone/degree_value" />"/>
						<input type="hidden" name="milestones/milestone[${flag}${index}]/prof_title_value" value="<x:out select="$milestone/prof_title_value" />"/>
						<input type="hidden" name="milestones/milestone[${flag}${index}]/qualification" value="<x:out select="$milestone/qualification" />"/>
						<input type="hidden" name="milestones/milestone[${flag}${index}]/card_type_name" value="<x:out select="$milestone/card_type_name" />"/>
						<input type="hidden" name="milestones/milestone[${flag}${index}]/oversea_value" value="<x:out select="$milestone/oversea_value" />"/>
						<input type="hidden" name="milestones/milestone[${flag}${index}]/oversea_name" value="<x:out select="$milestone/oversea_name" />"/>
						<input type="hidden" name="milestones/milestone[${flag}${index}]/before_address" value="<x:out select="$milestone/before_address" />"/>
						<input type="hidden" name="milestones/milestone[${flag}${index}]/before_position" value="<x:out select="$milestone/before_position" />"/>
						<input type="hidden" name="milestones/milestone[${flag}${index}]/before_dept" value="<x:out select="$milestone/before_dept" />"/>
						<input type="hidden" name="milestones/milestone[${flag}${index}]/come_time" value="<x:out select="$milestone/come_time" />"/>
						<input type="hidden" name="milestones/milestone[${flag}${index}]/mobile" value="<x:out select="$milestone/mobile" />"/>
						<input type="hidden" name="milestones/milestone[${flag}${index}]/email" value="<x:out select="$milestone/email" />"/>
						<input type="hidden" name="milestones/milestone[${flag}${index}]/state_plan" value="<x:out select="$milestone/state_plan" />"/>
						<input type="hidden" name="milestones/milestone[${flag}${index}]/state_time" value="<x:out select="$milestone/state_time" />"/>
						<input type="hidden" name="milestones/milestone[${flag}${index}]/state_declared" value="<x:out select="$milestone/state_declared" />"/>
						<input type="hidden" name="milestones/milestone[${flag}${index}]/local_plan" value="<x:out select="$milestone/local_plan" />"/>
						<input type="hidden" name="milestones/milestone[${flag}${index}]/local_time" value="<x:out select="$milestone/local_time" />"/>
						<input type="hidden" name="milestones/milestone[${flag}${index}]/plan_level_value" value="<x:out select="$milestone/plan_level_value" />"/>
						<input type="hidden" name="milestones/milestone[${flag}${index}]/plan_level_name" value="<x:out select="$milestone/plan_level_name" />"/>
						<input type="hidden" name="milestones/milestone[${flag}${index}]/get_cost" value="<x:out select="$milestone/get_cost" />"/>
						<input type="hidden" name="milestones/milestone[${flag}${index}]/achievements_hidden" value="<x:out select="$milestone/achievements_hidden" />"/>
						<input type="hidden" name="milestones/milestone[${flag}${index}]/achievements" value="<x:out select="$milestone/achievements" />"/>
					</td>
					<td align="center">
					<span name="milestones/milestone[${flag}${index}]@seq_no">${index+1}</span>
					</td>
					<td align="center">
						<span name="milestones/milestone[${flag}${index}]/zh_name"><x:out select="$milestone/zh_name" /></span>
					</td>
					<td align="center">
						<span name="milestones/milestone[${flag}${index}]/gender_name"><x:out select="$milestone/gender_name" /></span>
					</td>
					<td align="center">
						<span name="milestones/milestone[${flag}${index}]/degree_name"><x:out select="$milestone/degree_name" /></span>
					</td>
					<td align="center">
						<span name="milestones/milestone[${flag}${index}]/major_work"><x:out select="$milestone/major_work" /></span>
					</td>
					
					<td align="center">
						<span name="milestones/milestone[${flag}${index}]/prof_title_name"><x:out select="$milestone/prof_title_name" /></span>
					</td>
					
					<td align="center">
						<span name="milestones/milestone[${flag}${index}]/country_name"><x:out select="$milestone/country_name" /></span>
					</td>
				</tr>
				<c:set value="${index+1}" var="index" scope="page" />
			</x:forEach>
			</tbody>
	</table>
<br>

	<table border="0" cellpadding="0" cellspacing="1">
		<tr>
			<td>
				<input class="button_02" type="button" id="zh_tj"  value="添加" onclick="if(checkTabLimit('milestone_edit',100,'科技团队核心成员基本情况多只能填写100条')){addNewRow('milestone_edit','${ctx}/proposal/edit/dialog/prpMilestonesInfoEdit_qyyftr?parentTab=milestone_edit&type=add&needMeetingInfo=${param.needMeetingInfo}&TB_iframe=true&height=440&width=870','科技团队核心成员基本情况');}try{top.resizeFrame();}catch(e){};">
				&nbsp;<input class="button_02"  id="zh_psnPrev" type="button" value="上移" onclick="movePrev('milestone_edit','selMilestone_edit');">
				&nbsp;<input class="button_02"  id="zh_psnNext" type="button" value="下移" onclick="moveNext('milestone_edit','selMilestone_edit');">
				&nbsp;<input class="button_02"  id="zh_psnEdit" type="button" value="编辑" onclick="editRow('milestone_edit','${ctx}/proposal/edit/dialog/prpMilestonesInfoEdit_qyyftr?parentTab=milestone_edit&type=edit&needMeetingInfo=${param.needMeetingInfo}&TB_iframe=true&height=440&width=870','编辑项目计划信息')">
				&nbsp;<input class="button_02"  id="zh_psnDel" type="button" value="删除" onclick="deleteSelectedRow('milestone_edit','科技团队核心成员基本情况');"></td>
		</tr>
	</table>
<textarea id="xmlStr" style="display: none" >${xmlstr}</textarea>
<br/>	

<script type="text/javascript">
	showAllDateTag("milestone_edit");
	$(function(){
		
		//将申请书xml中的研究领域xml字符串设置到每个设备的对应隐藏域
		setEquipment("milestone_edit", "xmlStr");
		setCertificate("milestone_edit", "xmlStr");
	});
	
 	function setEquipment(tblId, xmlId, nodeName){
		var xmlStr = $.trim($("#"+xmlId).val());
		
		if(xmlStr==null || xmlStr=="")
			return false;
		var reg = /[\r\n]/g;
		xmlStr=xmlStr.replace(reg,""); 
		var milestonesNode = /<milestones(.\n?)+?<\/milestones>/g;
		var milestones = xmlStr.match(milestonesNode);
		if(milestones==null || !milestones.length ||milestones.length==0)return;
		var milestoneNode = /<milestone[^s](.\n?)+?<\/milestone>/g;
		var milestone = milestones[0].match(milestoneNode);
		
		if(milestone != null){
			$("#"+tblId+" tr:gt(1)").each(function(i,obj){
				if(milestone[i]!=null){
					var equipments = milestone[i].match(/<equipments(.\n?)+?<\/equipments>/);
					if(equipments!=null){
						var str = equipments[0].replace(/<equipments.*?>|<\/equipments>/g,"");
						$(obj).find("[name$='/equipments']").val(str);
						
					}
				} 
				
			});
		}
	}
	
	
	
	function setCertificate(tblId, xmlId, nodeName){
		var xmlStr = $.trim($("#"+xmlId).val());
		
		if(xmlStr==null || xmlStr=="")
			return false;
		var reg = /[\r\n]/g;
		xmlStr=xmlStr.replace(reg,""); 
		var milestonesNode = /<milestones(.\n?)+?<\/milestones>/g;
		var milestones = xmlStr.match(milestonesNode);
		if(milestones==null || !milestones.length ||milestones.length==0)return;
		var milestoneNode = /<milestone[^s](.\n?)+?<\/milestone>/g;
		var milestone = milestones[0].match(milestoneNode);
		
		if(milestone != null){
			$("#"+tblId+" tr:gt(1)").each(function(i,obj){
				if(milestone[i]!=null){
					var certificates = milestone[i].match(/<certificates(.\n?)+?<\/certificates>/);
					if(certificates!=null){
						var str = certificates[0].replace(/<certificates.*?>|<\/certificates>/g,"");
						$(obj).find("[name$='/certificates']").val(str);
						
					}
				} 
				
			});
		}
	} 
	
</script>



























